/*
Copyright 2007 Julian Asamer

This file is part of Fractalicious.

    Fractalicious is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Fractalicious is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Fractalicious.  If not, see <http://www.gnu.org/licenses/>.
*/


#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import "DB.h"
#import "Spiral.h"
#import "Fern.h"
#import "Tree.h"
#import "Koch.h"

@implementation DB 
+ (NSMutableArray *) getFractals {
	NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity: 2];
		[arr addObject: [[FractalDescription alloc] initWithName: @"Spiral" class: [Spiral class]]];
		[arr addObject: [[FractalDescription alloc] initWithName: @"Tree" class: [Tree class]]];
		[arr addObject: [[FractalDescription alloc] initWithName: @"Fern" class: [Fern class]]];
		[arr addObject: [[FractalDescription alloc] initWithName: @"Koch" class: [Koch class]]];
		//Add new Fractals here! Just add a line like those above.
	return arr;
}
@end



@implementation FractalDescription
- (id)initWithName: (NSString *) string class: (Class) c {
	[super init];
	fractalClass = c;
	name = string;
	description = @"";
	return self;
}
- (id)initWithName: (NSString *) string {
	[super init];
	name = string;
	description = @"";
	return self;
}

- setClass: (Class) c {
	fractalClass = c;
}
- (Class)getClass {
	return fractalClass;
}
- setName: (NSString *)_name {
	name = _name;
}
- (NSString *)getName {
	return name;
}
- setDescription: (NSString *)d {
	description = d;
}
- (NSString *)getDiscription {
	return description;
}
@end

